package cn.tedu.oa_system.controller;

import cn.tedu.oa_system.base.json_result.ResultDataDto;
import cn.tedu.oa_system.base.json_result.ResultDto;
import cn.tedu.oa_system.pojo.StatusList;
import cn.tedu.oa_system.pojo.in.FindLikeKeyIn;
import cn.tedu.oa_system.pojo.in.StatusListIn;
import cn.tedu.oa_system.service.StatusListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author MW
 * @Description 状态控制器
 * @CreateDate 2023/3/8
 */
@RestController
@RequestMapping("/status")
@Slf4j
public class StatusListController {

    @Autowired
    private StatusListService statusListService;

    @PostMapping("/addnew")
    private ResultDto<Void> addNew(@RequestBody StatusListIn statusListIn){
        return statusListService.addNew(statusListIn);
    }

    @PostMapping("/delete")
    private ResultDto<Void> delete(@RequestBody StatusListIn statusListIn){
        return statusListService.delete(statusListIn);
    }

    @PostMapping("/update")
    private ResultDto<Void> update(@RequestBody StatusListIn statusListIn){
        return statusListService.update(statusListIn);
    }

    @PostMapping("/list")
    private ResultDataDto<StatusList> list(@RequestBody FindLikeKeyIn likeKeyIn){
        return statusListService.list(likeKeyIn);
    }
}
